#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2023/7/23 16:55
# @Author  : Jet
# @Email   : jyan@abot.cn
# @File    : flask_app.py

from flask import Flask, request, render_template

from flask_blueprint01 import blueprint01


app = Flask(__name__)

app.debug = True

app.config['UPLOAD_FOLDER'] = 'static/upload_file/'

app.public_web_host_root = 'http://www.tseo.cn'


app.register_blueprint(blueprint01, url_prefix='/blueprint01')

@app.route('/')
def index():

    print('host===>>>' + request.host)
    print(request)

    # return 'Hello World！app -->>> 12345678 延誉宝服务器更新中'

    web_root = app.public_web_host_root

    return render_template('index.html', web_root=web_root)



if __name__ == '__main__':
    # 生产环境
    # server = pywsgi.WSGIServer(('0.0.0.0', 8081), app)
    # server.serve_forever()

    # 开发环境 设置host为 0.0.0.0，可以局域网内访问
    app.run(host='0.0.0.0', port=8088)

